using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace DataDynamics.ActiveReports.Samples.Charting
{
	/// <summary>
	/// Summary description for ViewerForm.
	/// </summary>
	public class ViewerForm : System.Windows.Forms.Form
	{
		private DataDynamics.ActiveReports.Viewer.Viewer viewer1;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public ViewerForm()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.viewer1 = new DataDynamics.ActiveReports.Viewer.Viewer();
			this.SuspendLayout();
			// 
			// viewer1
			// 
			this.viewer1.BackColor = System.Drawing.SystemColors.Control;
			this.viewer1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.viewer1.Location = new System.Drawing.Point(0, 0);
			this.viewer1.Name = "viewer1";
			this.viewer1.ReportViewer.CurrentPage = 0;
			this.viewer1.ReportViewer.MultiplePageCols = 3;
			this.viewer1.ReportViewer.MultiplePageRows = 2;
			this.viewer1.Size = new System.Drawing.Size(656, 413);
			this.viewer1.TabIndex = 0;
			this.viewer1.TableOfContents.Text = "Table Of Contents";
			this.viewer1.TableOfContents.Width = 200;
			this.viewer1.Toolbar.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			// 
			// ViewerForm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(656, 413);
			this.Controls.Add(this.viewer1);
			this.Name = "ViewerForm";
			this.Text = "ActiveReports for .NET 3.0 Sample Viewer";
			this.Load += new System.EventHandler(this.ViewerForm_Load);
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new ViewerForm());
		}


		/// <summary>
		/// Loads up the report into the viewer control on the ViewerForm.
		/// The Load event will fire when the viewer control is loaded on the ViewerForm instance.
		/// </summary>
		/// <author>Data Dynamics</author>
		private void ViewerForm_Load(object sender, System.EventArgs e)
		{
			//instantiate and run a new report. 
			rptCharting rpt = new rptCharting();
			rpt.Run();
			viewer1.Document = rpt.Document;
		}
	}
}
